<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>




<body>


<script type="text/javascript">






	document.write("<br> <br> <b> 1. Function Arguments: </b>");
	
	function check(args){		
		var actual = args.length;
		var expected = args.callee.length;
		document.write("<br> Actual: " + actual + " Expected: " + expected);		
	}

	
	function add(x,y,z){
		check(arguments);
		document.write("<br> Result: " + (x+y+z));
		return x+z+y;		
	}
	
	add(3,5,6,7);
	add(1,2, 3);

	document.write("<br> <br> <b> 1. call() and apply(): </b>");
	document.write("<br> The call method on JavaScript functions allows you to change the functions context");
	document.write("<br> First Parameter: new context (object). Subsequent parameters: function parameters");
	
	document.write("<br>");
	
	var joe = {  
		name : "Joe",  
		greet : function (name) {  
		document.write("<br>" + this.name + " says hello to " + name);  
	}};  
		  
	var jill = {  
		name : "Jill"  
	};

	joe.greet.call(jill, "Franky")
	
	document.write("<br> <br> <b> 1. bind(): </b>");
	
	
	
	
	
	
	
	
	</script>

















</body>
</html>